package com.winchain.chainbill.chain.service.impl;

import com.shell.stellar.service.StellarAcctService;
import com.winchain.chainbill.chain.ChainAcctService;
import java.io.IOException;
import java.math.BigDecimal;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service("chainAcctService")
public class ChainAcctServiceImpl
  implements ChainAcctService
{
  @Autowired
  private StellarAcctService stellarAcctService;
  
  public BigDecimal getAcctBlc(String acctNo)
    throws IOException
  {
    String assetCode = acctNo.substring(0, 3);
    String realAcctNo = acctNo.substring(3);
    
    return new BigDecimal(this.stellarAcctService.getAcctBlc(realAcctNo, assetCode));
  }
}
